import threading
import time

class work(threading.Thread):
    def run(self):
        i  = 0
        while(i < 10):
            print(i)
            time.sleep(2)
            i += 1

if __name__ == "__main__":
    w = work()
    w.start()
    w.join()